<%@page import="org.blackjuly.sign.util.DateUtil"%>
<%@page import="org.blackjuly.sign.util.BeanUtil"%>
<%@page import="org.blackjuly.sign.web.CommentManager"%>
<%@page import="org.blackjuly.sign.service.CommentService"%>
<%@page import="org.blackjuly.sign.entity.Comment"%>
<%@page import="java.sql.Connection"%>
<%@page import="org.blackjuly.sign.data.SystemDataSource"%>
<%@page import="org.blackjuly.sign.service.UserService"%>
<%@page import="org.blackjuly.sign.web.RequestManager"%>
<%@page language="java" pageEncoding="utf-8"%>
<%@include file="auth.jsp"%>
<%
String from = request.getParameter("from");
String content = request.getParameter("content");
Connection conn = SystemDataSource.getInstance().getConnection();
CommentService commentService = new CommentService();
CommentManager cm = new CommentManager(userSession);
Comment comment = new Comment();
commentService.setConnection(conn);
BeanUtil.copyProperties(userSession, comment);
comment.setContent(content);
comment.setTime(DateUtil.getTime());
comment.setId(commentService.findBestId(from));
commentService.comment(comment,from);
SystemDataSource.close(conn);
out.println("评论成功，三秒后跳转");
response.setHeader("refresh", "3;URL=home.jsp");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>评论成功</title>
</head>
<body>

</body>
</html>